Apple, which hit a new 52-week low on Monday, enjoyed a bounce with the broader market. Shares rose more than 2% Tuesday, but the stock is still down nearly 20% this year. Meanwhile, Google closed at a new record high.

After the market close, gun maker Smith & Wesson Holding Co is expected to report strong quarterly results. Gun sales have surged in recent months amid speculation about new gun control laws.

European markets ended higher, while Asian markets also ended with gains after Chinese Premier Wen Jiabao announced the government will carry a larger deficit in 2013 to help the world's No. 2 economy reach its goal of 7.5% growth this year.

The dollar fell against the euro, the British pound and the Japanese yen.

Oil and gold prices edged higher.

The price on the 10-year Treasury declined, pushing the yield up to 1.90% from 1.88% late Monday.