Oil rose for a third day on Thursday, with Brent crude reaching its highest so far this year, but gains were capped after the steepest decline in U.S. retail spending since 2009 heightened investor fears of a global economic slowdown.

Prices clawed back gains after stock markets pared some losses. Crude futures also drew support from investor optimism that the United States and China could resolve their trade dispute.

Brent crude futures were up 82 cents, or 1.3 percent, at $64.43 a barrel around 2:25 p.m. ET, down from a session high of $64.81, their highest intraday level in nearly three months.

U.S. crude futures ended Thursday's session 51 cents higher at $54.33 a barrel, posting a 1 percent gain on the day.

U.S. financial markets opened lower and global stock markets erased broad gains after retail sales in the world's largest economy recorded their biggest drop in more than nine years in December.

The U.S. economy's outlook was further dimmed by other data showing an unexpected increase in the number of Americans filing claims for unemployment benefits last week.

"Oil prices sold off in reaction to the very weak retail sales data in the U.S. that drove selling across-the-board," said John Kilduff, a partner at Again Capital Management in New York.

"Once again, the weak demand narrative is outweighing some of the other supportive factors on the supply side."

The price of crude has risen 20 percent this year, driven primarily by the prospect of a decline in oil supply from OPEC and other top exporters such as Russia.

The producer group known as OPEC+ has agreed to cut crude output by a joint 1.2 million barrels per day. Top exporter Saudi Arabia said it would cut even more in March than the deal called for.