UPDATE 8-Oil rises to 3-wk high on Mideast tensions, Venezuela concerns

* Geopolitical factors support prices

* Relentless rise in U.S. crude output caps gains

* Gasoline futures rise to highest since August 2017

* Coming up: API data to be released 4:30 p.m. EDT (Updates to market settle, adds commentary)

NEW YORK, March 20 (Reuters) - Oil prices climbed to their highest level in three weeks on Tuesday as tension in the Middle East and the possibility of further falls in Venezuelan output helped offset the impact of growing U.S. crude production.

Brent crude futures for May delivery rose $1.37 to $67.42 a barrel, a 2.07 percent gain. Brent rose to $67.88 during the session, its highest level since late February. U.S. West Texas Intermediate (WTI) crude futures for April delivery rose $1.34 to settle at $63.40 a barrel, a 2.2 percent gain. WTI traded between $62.08 and $63.81.

The more active May U.S. crude futures rose $1.41 to settle at $63.54 a barrel.

Brent and WTI both notched their largest daily percentage gains since March 9.

Geopolitical risks were top of mind on Tuesday. Saudi Arabia called the 2015 nuclear deal between Iran and world powers a "flawed agreement" on Monday, on the eve of a meeting between Crown Prince Mohammed bin Salman and U.S. President Donald Trump.

Trump has threatened to withdraw the United States from the accord between Tehran and six world powers, raising the prospect of new sanctions that could hurt Iran's oil industry.

"There's an expectation that 1/8Trump and Prince Mohammed 3/8 are going to take a harder line on Iran, and that's bringing prices up," said Phil Flynn, a senior energy analyst at Price Futures Group in Chicago.

Worries about falling production in Venezuela, whose output has been halved since 2005 to below 2 million barrels per day (bpd) <PRODN-VE> due to the country's economic crisis, also supported oil markets.

The International Energy Agency said last week Venezuela was "vulnerable to an accelerated decline" and that the Latin American country could trigger a renewed drawdown in stocks.

However, increased output in the United States, Canada and Brazil has capped oil price gains. U.S. crude oil production <C-OUT-T-EIA> has risen more than a fifth since mid-2016, to 10.38 million bpd.

The ramped-up production threatens to undermine cuts made by the Organization of the Petroleum Exporting Countries in an effort to draw down a global supply glut.

Appetite for U.S. crude is adding to the headache facing OPEC. A widening discount of WTI to Brent crude makes it more attractive for foreign refiners to process U.S. oil. Brent is the benchmark for several Middle East and other global crudes.

The premium of Brent crude to WTI <WTCLc1-LCOc1> rose above $4 a barrel on Tuesday.

Market participants will look to data from industry group the American Petroleum Institute to provide further indications of U.S. supply. Analysts expect the data, scheduled to be released at 4:30 p.m. EDT (2030 GMT), to show that U.S. crude inventories rose for a fourth straight week.

Gasoline futures on the New York Mercantile Exchange rose 2.1 percent on Tuesday to settle at $1.9659, the highest level since August 2017.

Data from market intelligence firm Genscape showed gasoline inventories in the New York harbor region fell by about 1.1 million barrels last week, traders who saw the data said.

(Additional reporting by Amanda Cooper in London and Henning Gloystein in Singapore Editing by Frances Kerry and Leslie Adler)