Oil climbed for a fourth day as the US continued attacks on Iran in a bid to secure shipping through the Strait of Hormuz.