* Brent oil falls after North Korea nuclear test
* Traders pull cash out of crude, pour into gold
* U.S. refineries resume activity after Hurricane Harvey (Recasts, updates prices, changes dateline previous LONDON)
NEW YORK, Sept 4 (Reuters) - U.S. crude oil prices edged higher on Monday while gasoline prices slumped to pre-Hurricane Harvey levels, as oil refineries and pipelines in the U.S. Gulf Coast slowly resumed activity, easing supply concerns.
U.S. West Texas Intermediate (WTI) crude futures were up 20 cents at $47.49 per barrel by 11:22 a.m. EDT (1522 GMT) as U.S. demand, hit by reduced refinery activity since Harvey made landfall on Aug. 25, recovered.
Brent crude oil futures fell by 35 cents to $52.40, due in part to a shift away from crude markets to assets perceived to be safer, such as gold, after a powerful North Korean nuclear test.
NYMEX gasoline futures were down 3.24 percent at $1.6913 a gallon, levels last seen on Aug. 25, crippling production and causing widespread flooding.
Damage to the oil infrastructure in the Gulf Coast hub by Harvey appeared less extensive than some had feared.
A number of major refineries, which convert crude oil to refined products such as gasoline and jet fuel, were gradually resuming operations on Monday. Colonial Pipeline, the largest American fuel system, was restarting the distillates segment of its pipeline from Texas to New Jersey.
The gasoline pipeline was due to resume operations on Tuesday, the company said.
At the same time, about 5.5 percent of the U.S. Gulf of Mexico's oil production, or 96,000 barrels of daily output, remained shut on Sunday, down from a peak of more than 400,000 bpd last week.
"The disruptions from Hurricane Harvey in the U.S. Gulf Coast are gradually clearing. In the broader scheme of things, it appears that so far the energy industry was spared major damages to assets and infrastructure," analysts at Vienna-based JBC Energy said in a note.
"However, some Houston-area refineries will likely remain offline for some time longer."
Traders booked dozens of gasoline tankers over the past week from Asia and Europe to the United States and Latin America in order to plug supply shortages in the wake of the shutdowns.
European gasoline refining margins dropped by nearly a fifth on Monday.
And while the U.S. government tapped its strategic oil reserves for the first time in five years last week, the head of the International Energy Agency (IEA) said the global energy watchdog still sees no need for a coordinated international release of oil stocks after Harvey.
Texas Governor Greg Abbott estimated damage at $150 billion to $180 billion, calling it more costly than Hurricanes Katrina or Sandy, which hit New Orleans in 2005 and New York in 2012 respectively.
Traders were nervously watching developments in North Korea, where the military conducted its sixth and most powerful nuclear test during the weekend. Pyongyang said it had tested an advanced hydrogen bomb for a long-range missile, prompting the threat of a massive military response from the United States if it or its allies were threatened.
That put downward pressure on crude as traders moved money out of oil - seen as high-risk markets - into gold futures , traditionally viewed as a safe haven for investors. Spot gold prices rose for a third day, gaining 0.9 percent on Monday.
Overall trading activity in the oil futures market was expected to be low on Monday due to the U.S. Labor Day public holiday.
(Additional reporting by Ron Bousso in London and Henning Gloystein in Singapore; Editing by Bill Trott)