Stocks edged higher in a choppy session on Friday, led by a rebound in energy shares, but worries about a massive earthquake in Japan and the strength of the U.S. consumer capped gains.

The Dow Jones industrial average <.DJI> gained 20.13 points, or 0.17 percent, to 12,004.74. The Standard & Poor's 500 Index <.SPX> rose 5.84 points, or 0.45 percent, to 1,300.95. The Nasdaq Composite Index <.IXIC> added 7.45 points, or 0.28 percent, to 2,708.47.