NEW YORK (TheStreet) -- What a difference a day makes. Stock closed higher as investors bet the Federal Reserve will delay its looming rate hike as Greece flirts with default. 

The S&P 500 rose 0.26%, the Dow Jones Industrial Average gained 0.13% and the Nasdaq increased 0.57%, following a major selloff in all the indices on Monday, when the Dow lost 350 points. 

For the quarter, the Dow is down 0.9% and 1.15% for the year. The S&P 500 fell 0.24% during the second quarter, but rose 0.2% year-to-date. The Nasdaq rose 1.8% quarter-to-date and 5.3% for the year.

"The situation in Greece has the potential to delay a Fed rate increase until December or even next year should the situation deteriorate further," wrote Brian Rehling, co-head of global fixed income strategy at Wells Fargo Investment Institute in a Tuesday note. "We still expect the Fed to begin raising rates this year."

Meanwhile, former Fed Gov. Larry Lindsey told CNBC that central bankers will point to the drama in Greece as a reason to push its looming rate hike further down the road. 

Greece announced over the weekend that it will hold a referendum on July 5 to allow citizens to decide if the country should remain in the 19-country eurozone. A "Grexit" would mean a return to Greece's old drachma currency. Though sources told Reuters that Greek officials are open to nixing the referendum in order to make way for a debt deal. 

Reports suggest German Chancellor Angela Merkel won't negotiate any last-minute debt deal with Greece before Sunday's referendum. That makes a default all the more likely.

The debt-laden country has a $1.7 billion payment due to the International Monetary Fund at midnight Tuesday Athens time.

Investors in Europe weren't optimistic about a Greek resolution, with London's FTSE 100 wrapping up Tuesday's session to the downside by 1.1%. The euro lost 0.8% against the dollar. Oil prices rose 1.7% to $59.32 a barrel for West Texas intermediate crude.

Greece isn't the only place with a debt crisis on its hands. Puerto Rico's Gov. Alejandro Garcia Padilla said on Sunday that the U.S. commonwealth's $72 billion in debt is "not payable," posing risks for the U.S. municipal bond market. The White House said a bailout for Puerto Rico was not being considered.

Apple's (AAPL) - Get Report streaming music service begins on Tuesday for $9.99 a month, following a 90-day free trial. The service will include music from Taylor Swift, who removed her songs from competitor streaming service Spotify. Apple's service is also set to compete with Pandora (P) .

Willis (WSH) and Towers Watson (TW) - Get Report have agreed to merge in a deal valued at roughly $18 billion. The new company will be called Willis Towers Watson and will have 39,000 employees across 120 nations. Willis shares rose 3%, while Towers Watson fell 8.8%.

Shares of Apollo Education (APOL) slumped 17% after the company reported third-quarter earnings per share of 53 cents, on an adjusted basis, down from 78 cents a year earlier.

Celgene (CELG) - Get Report shares rose 0.7% after the company said it will spend $1 billion over the next decade in a partnership with Juno Therapeutics (JUNO) to develop treatments for various immune system diseases.

ConAgra Foods (CAG) - Get Report reported adjusted quarterly earnings per share of 59 cents, in line with estimates. Shares rose 0.7% after the company announced that it expects to exit its private label operations.

AOL (AOL) will take control of Microsoft's (MSFT) - Get Report Web display advertising operations. AOL was recently acquired by Verizon (VZ) - Get Report. Shares of Microsoft fell 0.5%.