Oil prices retreat, but heads for third weekly rise on demand recovery