Williams said the problem also affected her earlier this week.
"It was feeling a little stiff and I don't think this is the right moment to force (it)," she said. "I just want to relax and get ready for the next few months."
The withdrawal comes eight days before the French Open, but Williams said the move was mainly precautionary and that she'll be ready for the clay-court major.
"This is a good week to get better and I'm confident that I'll be 100 percent," she said.
The decision ended Williams' winning streak at 17 matches. She had won consecutive titles in Charleston, South Carolina, and Madrid, plus two matches in Fed Cup.
Several other players are also nursing injuries.
Wimbledon champion Petra Kvitova was bothered by an abdominal injury in a three-set loss to Kerber in the quarterfinals. And Italy's Flavia Pennetta retired with a right wrist injury while trailing Williams 4-0 in the first set Friday.