Two municipal water systems in New Jersey were targeted in cyberattacks in the last week, widely thought to be the work of Iran, the state said Wednesday.