Oil prices gain as US, Iran exchange attacks