Oil prices firm as global stock markets rebound, dollar falls