Iran has released a Marshall Islands-flagged tanker and its 21 crew members, days after seizing the ship without explanation.