SINGAPORE, Sept 4 (Reuters) - Oil markets were volatile on Monday, supported by shutdowns of U.S. production following Hurricane Harvey, but pressured by an expected downturn in crude demand as the storm knocked out refineries along the Gulf of Mexico coast.

Harvey, which made landfall along the Gulf coast of Texas and Louisiana last week, knocked out almost a quarter of the entire U.S. refining capacity, causing a price spike and supply gap for fuels like gasoline which traders around the world have been scrambling to fill.

It also hit some U.S. oil production, yet has at the same time cut demand for crude from the crippled petroleum industry, resulting in a mixed and volatile market reaction.

U.S. West Texas Intermediate (WTI) crude futures were at $47.45 barrel at 0119 GMT, 17 cents above their last settlement.

However, international Brent crude oil futures were at $52.53 per barrel, down 22 cents, or 0.4 percent from their last close.

Markets were also nervously eyeing developments in North Korea, where the military conducted its sixth and most powerful nuclear test over the weekend, which the government said was of 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.

Some downward pressure came from traders cutting back bullish wagers on crude. Trade data on Friday showed that financial traders had cut their combined long futures and options position in New York and London by 105,377 contracts to 165,896 in the week to Aug. 29, the lowest level since late June.

Traders said that the cutbacks were a result of expectations of lower crude demand due to the large-scale closure of U.S. refineries.

“Approximately 22 percent of U.S. refining capacity .. remains offline because of the subsequent damage,” ANZ bank said on Monday.

However, 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, the federal Bureau of Safety and Environmental Enforcement said.

Although some U.S. Gulf drillers, refineries and fuel pipelines were gradually restarting operations, analysts say it will likely take months to return to normal operations.

Texas Governor Greg Abbott estimated damage at $150 billion to $180 billion, calling it more costly than Hurricanes Katrina or Sandy, which devastated New Orleans in 2005 and New York in 2012. (Reporting by Henning Gloystein; Editing by Joseph Radford)