Stocks rose on Tuesday as energy shares rallied on higher crude oil prices, but trading was volatile after German Chancellor Angela Merkel rejected any suggestion of raising the limit on Europe's bailout fund.

Investors had been closely eyeing developments on the fund, the European Stability Mechanism (ESM), which will go into effect from the middle of next year and replace the current European Financial Stability Fund. The ESM will have an effective lending capacity of 500 billion euros.

I am surprised that the market is holding up, said Peter Cardillo, Chief Market Economist, Rockwell Global Capital in New York. Germany is playing a hard ball game and they have no choice but to do so.

Energy stocks gained as U.S. crude oil futures prices rose more than 3 percent to top $100 a barrel at the session high, with traders citing tension between the West and Iran as a possible trigger.

The S&P energy index <.GSPE> added more than 2 percent before trimming gains. It was last up 1.1 percent, with blue-chip Chevron up 1.7 percent at $104.79.

The Dow Jones industrial average <.DJI> was up 69.70 points, or 0.58 percent, at 12,091.09. The Standard & Poor's 500 Index <.SPX> was up 4.70 points, or 0.38 percent, at 1,241.17. The Nasdaq Composite Index <.IXIC> was up 1.04 points, or 0.04 percent, at 2,613.30.

Consumer-related stocks were the worst performers. Shares of Best Buy tumbled 11.5 percent to $24.83 after the electronics retailer reported a quarterly profit below expectations as bigger discounts squeezed margins.

The Federal Reserve was holding its last meeting of the year on Tuesday, and a policy statement was expected around 2:15 p.m. <1915 GMT>. Investors look for the Fed to hold off on any fresh economic stimulus as it weighs encouraging signs on the recovery against risks coming from Europe.

U.S. government data showed U.S. retail sales rose less than expected in November as a drop in receipts for food and beverages weighed against stronger sales of motor vehicles, tempering expectations of a strong holiday shopping season.

(Reporting by Angela Moon; Editing by Leslie Adler)