NEW YORK (CNNMoney) -- U.S. stocks moved higher Tuesday, erasing earlier losses, on hopes that Greece is nearing a deal to secure more bailout money.
The Dow Jones industrial average () rose 33 points, or 0.3%, to close at 12,878. The S&P 500 ( ) gained 3 points, or 0.2%, to 1,347. The Nasdaq ( ) edged up 2 points, or 0.1%, to 2,904.
Stocks opened lower amid concerns that Greek politicians might not reach an agreement on reforms needed to secure fresh bailout money and avoid a default. But traders said the tone improved after reports suggested that progress has been made in the negotiations.
"The big news today is Greece," said Dimitre Genov, senior portfolio manager at Artio Global Investors. "People are worried that there will be no resolution, but there seems to be news that things are going in the right direction," he said.
In a sign of optimism, the euro rose versus the U.S. dollar to the highest level since early December.
Prime Minister Lucas Papademos has reportedly finalized a draft of reforms including job and salary cuts, pension reforms and other policies to reduce public spending.
But a meeting of top leaders from Greece's main political parties has been pushed back to Wednesday, after talks were postponed earlier this week, the prime minister's office said.
The reforms are needed for Greece to receive a second bailout of €130 billion from the European Union, International Monetary Fund and European Central Bank. Without additional funding, Greece will most likely miss a €14.5 billion bond redemption in March, sending shock waves throughout the global financial system.
Meanwhile, Greek labor unions held a general strike to protest the measures. The Greek government is tentatively set to hold general elections in April.
"All eyes are on the Greek debt talks right now," said Tim Moore, a portfolio manager at Cabot Money Management in Salem, Mass. "Europe is doing everything it can to keep Greece and the banks afloat, but it's a long-term process."
Moore said investors have been encouraged by recent moves by the European Central Bank to stabilize the banking sector. And an improved outlook for the U.S. economy has helped boost the market so far this year, he added.
So far this year, the Nasdaq is up 11%, the S&P 500 is up about 7%, and the Dow has gained 5%.
"Stocks are finally reacting to actual fundamentals," said Moore.
With little economic or corporate news,U.S. stocks hovered below the breakeven line Monday.
World markets: European stocks ended mixed. The DAX ( ) in Germany dropped 0.1%, and France's CAC 40 ( ) gained 0.1%. Britain's FTSE 100 ( ) ended flat.
Asian markets ended in the red. The Shanghai Composite () dropped 1.7%, while the Hang Seng ( ) in Hong Kong and Japan's Nikkei ( ) slipped 0.1%.
Economy: The Federal Reserve said consumer credit rose by $19.3 billion to $2.5 trillion in December. Analysts surveyed by Briefing.com expect the report to show that consumer credit expanded by $8.5 billion.
After the market closed, Walt Disney (Fortune 500) said fourth-quarter earnings rose 17% to 80 cents per share, topping analysts' expectations.,
Earlier, oil company BP posted increased fourth-quarter profits and raised its dividend on Tuesday. The company hailed the improved result as a turning point in the long climb back from Gulf of Mexico oil spill of 2010.
But shares of BP () slipped, as investors remain wary of how much the spill will cost following a trial that is set to begin later this month.
Shares of UBS () lost ground after the Swiss bank posted a 75% drop in its fourth-quarter profit and missed forecasts. The bank also issued a bleak outlook for the current quarter -- noting that concerns over the European debt crisis, U.S. deficit and ongoing uncertainty about the global economic outlook will have a "negative influence on client activity levels."
Yum! Brands' (Fortune 500) stock rose nearly 3% after the fast-food operator topped earnings expectations late Monday, thanks to sales growth in China.,
Coca-Cola (Fortune 500) shares edged higher after the beverage maker topped earnings and sales estimates for the fourth quarter.,
Insurance company Unum Group (Fortune 500) reported a net loss for the fourth quarter, driven largely by a one-time charge. Shares fell nearly 4%.,
Oil for March delivery rose $1.50 to end at $98.41 a barrel.
Gold futures for April delivery rose $23.50 to settle at $1,748.40 an ounce.
Bonds: The price on the benchmark 10-year U.S. Treasury fell, and the yield rose to 1.97%.
|What we want Apple to unveil at WWDC|
|Millennials squeezed out of buying a home|
|7 traits the rich have in common|
|Big Data knows you're sick, tired and depressed|
|Your car is a giant computer - and it can be hacked|
|Overnight Avg Rate||Latest||Change||Last Week|
|30 yr fixed||3.63%||3.67%|
|15 yr fixed||2.77%||2.78%|
|30 yr refi||3.67%||3.71%|
|15 yr refi||2.83%||2.84%|
Today's featured rates: