Oil gains 2 percent as global markets stabilize, dollar dips