Record oil prices helped Chevron offset losses at its refining unit and a slight fall in energy production last year.