Oil gains as hurricane shuts US output, stockpiles fall