US oil settles up $1.14, or 2%, at $59.47 a barrel

Workers from Select Energy Services at a Hess fracking site near Williston, N.D.
Andrew Cullen | Reuters
Workers from Select Energy Services at a Hess fracking site near Williston, N.D.

Oil prices bounced from three-week lows in choppy trade on Tuesday as investors awaited a Greek debt default.

U.S. crude closed up $1.14, or 2 percent, at $59.47 a barrel. Brent crude futures were up $160, or 2.6 percent, at $63.60 a barrel, after falling to $62.01 on Monday, the weakest finish since June 5.

Read More This could be the tipping point for oil prices

"Markets are worried that a Greek debt default could hit European economic growth and thus fuel demand," said Tamas Varga, oil analyst at London brokerage PVM Oil Associates.

"Capital controls are not bullish for the economy, and not bullish for oil. How much can you spend on gasoline if you can't withdraw more than 60 euros a day?"

Commodities tomorrow: Dollar up, crude down
Commodities tomorrow: Dollar up, crude down   

Greek government sources have said the country will default on a crucial repayment due to the International Monetary Fund later on Tuesday, plunging it deeper into financial crisis.

No resolution to the debt crisis is likely before a referendum on Greece's bailout on Sunday.

Investors kept a close eye on talks in Vienna on Iran's nuclear program that could end years of economic sanctions on the Islamic Republic and eventually allow a big increase in Iranian oil exports.

Iran and six world powers gave themselves an extra week to reach a final nuclear accord after it became clear they would miss a deadline on Tuesday, with U.S. and Iranian officials sounding upbeat even though obstacles remain.

Read MoreKerry runs into nuke talks roadblock: Iran analyst

Diplomats and analysts have said a deal with Iran in Vienna is likely to be agreed, although it is not clear how long it would take to ease sanctions or how great an impact that would have on Iranian oil production or exports.

Asian imports of Iranian crude rose to the highest level this year in May at 1.2 million barrels per day, according to final figures on Tuesday. But they held at slightly above 1 million bpd for the first five months of the year, the level allowed under sanctions on Tehran.

The market awaited a U.S. government payrolls report on Thursday for clues on when the U.S. Federal Reserve could raise interest rates, the first such increase in about 10 years.