Oil prices rally from sharp losses