* Brent, WTI on track for biggest weekly gains in two months
* U.S. refineries restarting after hurricane shutdowns
* HSBC says convinced of longer-term upside to oil prices
* Coming Up: Baker Hughes U.S. oil rig count at 1 p.m. (1700 GMT) (Updates prices, adds comment, changes dateline, previous AMSTERDAM)
NEW YORK, Sept 15 (Reuters) - Brent oil prices held near five-month highs on Friday, and were on track for the biggest weekly gain since late July, on forecasts for rising demand and the gradual restart of U.S. oil refineries.
The Organization of the Petroleum Exporting Countries this week forecast higher demand for its oil in 2018 and pointed to signs of a tighter global market, indicating its deal with non-OPEC states to cut output is helping tackle a glut.
That was followed by a report from the International Energy Agency (IEA) saying the glut was shrinking thanks to strong European and U.S. demand, as well as production declines in OPEC and non-OPEC countries.
"This boost to the market is attracting fresh speculative length," said Gene McGillian, director of market research at Tradition Energy in Stamford.
To sustain current high prices, continued strength in demand is needed, he said, noting that a weak fourth quarter in the U.S. could prompt traders to back off of long positions.
Brent crude was down 3 cents at $55.45 a barrel by 12:31 p.m. EDT (1731 GMT), in a volatile session that saw it stretch from an intraday low of $54.86 to a high of $55.85 a barrel.
The benchmark was on track for its third straight weekly gain, rising 3.1 percent so far, which would be the highest weekly rise since the end of July.
U.S. West Texas Intermediate crude was down 17 cents at $49.73 a barrel. The contract looked set for a 5 percent weekly gain, also its strongest in nearly two months.
"Prices have now advanced for the last two weeks off increased demand forecasts from both OPEC and the IEA combined with the near-term demand uplift expected as U.S. oil refineries seek to restart operations post-Hurricane Harvey," analysts at Panmure Gordon said.
Oil investors eyed further impact from increasing crude demand from U.S. oil refineries restarting after hurricane outages.
On Wednesday, 13 of 20 affected U.S. refineries were at or near normal operating rates and another five were restarting or ramping up, according to IHS Markit. The largest U.S. refinery, Motiva Enterprises plant in Port Arthur, Texas, was at half its full capacity, the company said Wednesday.
Analysts at HSBC said that despite the U.S. refinery outages, 2017 was set to be an "extremely strong year" for oil demand growth, a key factor underpinning a rise in prices.
"We remain convinced of longer-term upside to crude prices. With the lack of new major project sanctions, we expect conventional non-OPEC supply to start declining post-2018," they said.
They maintained their 2018 and 2019 Brent price assumptions at $65 and $70 a barrel, respectively.
Data on this week's U.S. oil rig count, an early indicator of future output, was due at about 1 p.m. (1700 GMT). U.S. energy firms last week cut oil rigs for a third time in the past four weeks as a 14-month drilling recovery stalled, General Electric Co's Baker Hughes energy services firm said.
(Additional reporting by Aaron Sheldrick in Tokyo and Karolin Schaps in Amsterdam; Editing by Marguerita Choy and Susan Fenton)