Williams said that she sustained the injury a few days ago and was unable to fully rotate, but refused to blame it for her loss.
"It's fine," she said. "You know, just nothing. I think everyone at this stage in the locker room has something wrong with them, so it's fine. There's no excuse there.
"A few days ago it just got really tight and I had no rotation on it. I went for this dropshot in the second set and it just locked up on me. I couldn't really rotate after that, which I guess is normal."
When asked if she thought about retiring, Williams replied: "I thought about it like for a nanosecond. I mean, it's a quarter-final of a Grand Slam. Even if I have to take off in a wheeler before I retire."
Stephens, 19, will now face Victoria Azarenka in the semi-finals in Melbourne.