Iran has confirmed the seizure of a Marshall Islands-flagged oil tanker in the Strait of Hormuz. State media reported the tanker was taken because it was carrying an illegal consignment.