Oil gains after cyberattack forces shutdown of crucial U.S. pipelines