The United States and Iran each said on Saturday they had attacked the other’s ships in the region, setting off a new round of retaliatory attacks days after some of the most intense fighting in weeks.