Oil rises in shift to risk assets as U.S. dollar slides