A better-than-expected reading of the ISM Services index gave markets a lift. The index for May rose to 53.7, surprising economists who had forecast the index would fall to 53.1 from April's 53.5. Any reading above 50 indicates growth in the service sector, which makes up the majority of the U.S. economy.

But ongoing concerns about Europe's debt problems kept the gains in check, as the Spanish banking system teeters on the edge of collapse and Greece comes closer to a possible exit from the euro.CNNMoney's Fear & Greed Index remained in extreme fear territory Tuesday.

Spanish Treasury Minister Cristobal Montoro told a Spanish radio network Tuesday that the country has been nearly shut out of global finance markets, and that its banking system would need help from other European countries. Yields on Spain's 10-year bond jumped as high as 6.5% before pulling back.

Meanwhile, credit rating agency Standard & Poor's said Monday that there is a one-in-three chance Greece will leave the euro currency union in the coming months.

Despite the gloomy news, investors were somewhat encouraged as finance officials of the world's seven largest economies, the G-7, held an emergency call Tuesday to discuss the region's crisis.

"They're talking about what can be done to throw a safety net or build a ring fence around some of the banks in southern Europe, so we don't see a flight of deposits," said Art Hogan, managing director at Lazard Capital Markets. "The fact that they're talking about it means something is in the works, and will come to fruition sooner rather than later."

According to a statement from the U.S. Treasury, the G-7 will continue to "monitor developments closely" ahead of the G-20 summit later this month in Mexico.

U.S. financial stocks were among the biggest gainers on the news. Shares of JPMorgan Chase (JPM, Fortune 500), Bank of America (BAC, Fortune 500) and Morgan Stanley (MS, Fortune 500) gained between 3% and 4%.

Netflix (NFLX) shares slipped after the company announced late Monday that it would start its own content delivery network to provide its streaming service to customers. Shares of Akamai (AKAM), a tech company that currently provides some of that service to Netflix, slid.

Shares of Research in Motion (RIMM) rebounded slightly Tuesday. The BlackBerry maker closed below $10 a share on Monday -- the lowest level since December 2003.