U.S. stocks advanced on Wednesday as materials shares rose, but rising commodities prices due to turmoil in the Middle East and North Africa could keep rallies modest.

The market's favored indicator of anxiety, the Chicago Board Options Exchange Volatility Index or VIX <.VIX>, shows investor worry over unsettled world situations has been tempered for the moment. But the lack of volume and moderate gains suggest optimism is limited in scope.

Nobody really wants to step in front, they are waiting to see, and obviously the selling was a little overdone on the Japan situation, said Peter Jankovskis, co-chief investment officer at OakBrook Investments LLC in Lisle, Illinois.

There is nothing else out there right now to kind of provide that kick up.

About 7.01 billion shares traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq -- below the daily average of 8.07 billion. The market posted the worst trading volume of the year on Tuesday.

The S&P index of materials stocks <.GSPM> rose 1.4 percent and was the S&P 500's top-performing sector. The sector climbed in sync with metals prices, including copper, which was up more than 2 percent.

Brent crude settled at $115.55 a barrel and U.S. crude gained 78 cents to settle at $105.75, the highest close since September 2008, as further unrest in Yemen added to risks of oil supply disruptions in the region.

These rising commodity costs could be with us for some time -- that creates a headwind for growth, said Karl Mills, president of Jurika, Mills & Keifer Investment Partners, in Oakland, California.

While higher oil prices would benefit energy companies, they would have a dampening effect on economic growth over a longer time horizon.

The Dow Jones industrial average <.DJI> gained 67.39 points, or 0.56 percent, to 12,086.02. The Standard & Poor's 500 Index <.SPX> rose 3.77 points, or 0.29 percent, to 1,297.54. The Nasdaq Composite Index <.IXIC> climbed 14.43 points, or 0.54 percent, to 2,698.30.

Freeport-McMoRan Copper & Gold shares jumped 5 percent to $54.88 after Chief Executive Richard Adkerson, speaking at a Reuters summit in New York, said the company has the balance sheet to handle a large acquisition.

As for the outlook for energy demand and costs, Mills said:

Japan now has to replace 10 percent of its electricity production, probably through natural gas and oil. Some of it will come from the Middle East, which is going through its own trouble right now.

That probably gives energy pricing more of a floor where it is.

Refiner Valero Energy gained 2.6 percent to $28.83. For the year, Valero's stock is up nearly 25 percent.

Shares of Exxon Mobil , up 0.05 percent at $82.60 on Wednesday, have gained 13 percent since the start of the year.

Money manager Van Eck Global resumed creating new shares of its Market Vectors Egypt Index Exchange Traded Fund after the local Egyptian market reopened. [ID:nN23254833] The fund was down 8.1 percent at $15.30, following losses in the Egyptian market.

Advancing stocks outnumbered declining ones on the NYSE by 1,635 to 1,325, while on the Nasdaq, advancers beat decliners 1,386 to 1,216.

(Reporting by Chuck Mikolajczak; Editing by Jan Paschal)