Oil prices set to cap off nightmare month with gains