Oil held a two-day gain after US President Donald Trump extended a ceasefire with Iran, even as peace talks faltered and a blockade of the Strait of Hormuz kept flows locked up.