Stocks close higher after oil stages a record rally