Just close the Straits to Iranian traffic. Escort other traffic safely through. Do this until they return the ships.
Since piracy is commerce related the obvious retaliating should be commercial. Cutting off all Iranian banks from international banking networks and crashing the Iranian economy would be a good start.