The North American benchmark oil price closed above $50 for the first time since last July, pushing the Canadian dollar higher along with it.

Oil gained 59 cents to trade back above $50 a barrel at $50.48 US on New York Mercantile Exchange.

Oil rallied because of concerns over potential supply shortages from attacks on Nigeria's oil industry and expectations of a likely drop in U.S. crude stockpiles, its third decline in as many weeks.

The price of oil has nearly doubled since January, boosted largely by a spate of unplanned outages that have eroded production in Canada, Venezuela, Libya and Nigeria, along with a steady decline in U.S. shale output.

Loonie higher

Much of oil's gain was tied to weakness in the U.S. dollar, which has been selling off since a weak jobs report on Friday. That has investors thinking the U.S. is in no rush to raise interest rates.

"It's all related. Oil is moving higher on the diminished threat of higher rates," said Jack Ablin, chief investment officer at BMO Private Bank in Chicago.

The loonie is also a beneficiary of the weakness in the U.S. dollar, and it gained a quarter of cent to 78.38 cents US on Tuesday. That's the highest level for Canada's currency in two weeks.

Speculators have placed more bets on the Canadian dollar in recent weeks, Commodity Futures Trading Commission data showed on Friday.

Net long Canadian dollar positions rose to 26,259 contracts in the week ended May 31 from 20,047 in the prior week.

The TSX was also in the green, up 89 points to close at 14,365.