The Iranian-flagged cargo ship, which had sailed from Malaysia, ignored warnings to stop, says the US president.