U.S. stocks climbed on Tuesday, with equities bouncing back after two days of losses, as investors embraced data that had consumer confidence hitting a six-year high in March.

"The markets are keying on the consumer confidence number, which surprised on the upside. The U.S. economy is dependent on consumers," said Chris Gaffney, EverBank senior market strategist.