* Brent falls, reverses Wednesday's gains
* U.S. distillates down 3.21 mln barrels - EIA
* U.S. crude oil build nearly 1 mln barrels - EIA
* China's factory activity contracts, first time in 6 months
(Adds settlement prices)
NEW YORK, Jan 23 (Reuters) - U.S. crude oil futures rose Thursday, narrowing the discount to European Brent to the lowest level in two months, due to a larger-than-expected draw in distillate stocks caused by sustained cold.
The freezing temperatures and a U.S. government report showing a 3.21-million-barrel draw on distillate stocks drove U.S. ultra low-sulfur diesel futures (ULSD), more commonly known as heating oil, to their highest price this year.
Analysts polled by Reuters had expected only a 900,000-barrel draw.
U.S. crude, which retreated slightly from earlier gains of more than $1, was also supported by Wednesday's start of TransCanada's Gulf Coast pipeline. That pipeline will eventually carry 700,000 barrels of oil per day (bpd) from Cushing, Oklahoma, the pricing point for the New York Mercantile Exchange, to Gulf Coast refineries.
U.S. crude's rally came in spite of a 990,000 barrel build in crude stocks, the first increase in eight weeks.
Brent oil fell Thursday after data showed China's factory sector contracted in January for the first time in six months. China is the world's second largest oil consumer.
U.S. oil's discount to Brent <CL-LCO1=R> narrowed by more than $1.50 to hit $9.98 per barrel. The spread broke the 100-day moving average of $10.48 for the first time in three-and-a-half months and contracted to its tightest point since early November.
"It stands to reason that if we see more and more domestically produced oil getting to the Gulf Coast refineries it is bullish for WTI prices," said Gene McGillian, an analyst with Tradition Energy in Stamford, Connecticut.
Brent lost 69 cents to settle at $107.58 a barrel, down from Wednesday when it settled at its highest level of the year - $1.54 higher at $108.27.
U.S. oil settled 59 cents higher at $97.32, its highest settlement price since New Year's Day. U.S. crude is on track to hit its largest weekly percentage gain in over two months.
Heating oil touched a high earlier in the day of $3.0875 per gallon, and settled up nearly 4 cents at $3.0765.
Analysts are watching to see if a spate of crude-by-rail accidents, which has spurred the debate about tighter rail safety standards, could impact U.S. oil markets by potentially raising transportation costs for refiners, analysts said.
"There's still some serious dislocation in the market; a lot of refiners have been mentioning rail delays, and usually into dislocations you get rallying markets," said Andy Lebow, vice president at Jefferies Bache in New York.
Thursday's moves came against a backdrop of talks to reach a peace agreement in Syria and the partial lifting of sanctions against Iran under a temporary deal with Western Powers trying to get Tehran to halt its most-sensitive nuclear-related activity.
Iran's president and oil minister told oil executives in Davos, Switzerland, on Thursday that Tehran will have a new investment model for oil contracts by September as it is keen to win back Western business.
(Additional reporting by Peg Mackey in London and Manash Goswami in Singapore; Editing by William Hardy, Jason Neely, Sophie Hares and Meredith Mazzilli)