Oil held the bulk of a gain as traders weighed geopolitical tensions from Venezuela to Russia and Iran against concerns about a glut.