* Brent oil falls after North Korea nuclear test
* Traders pull cash out of crude, pour into gold
* U.S. refineries resume activity after Storm Harvey (Updates prices)
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 8 cents higher at $47.37 per barrel at 1351 EDT (1751 GMT) as U.S. demand recovered after being hit by reduced refinery activity since Harvey made landfall on Aug. 25.
Brent crude futures settled 41 cents lower at $52.34, 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.28 percent at $1.6906 a gallon, a level last seen on Aug. 25.
Damage by Harvey to the oil infrastructure in the Gulf Coast 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.
Its 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 saw 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, whose 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 by 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 - 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 because of the U.S. Labor Day public holiday.
(Additional reporting by Ron Bousso in London and Henning Gloystein in Singapore; Editing by Bill Trott and Steve Orlofsky)