Oil ekes out gains as U.S. stimulus hopes lift global markets