New York-based stock exchange operator Nasdaq agreed to pay $4 million in a settlement with the US Department of Treasury over alleged violations of sanctions against Iran by a former Nasdaq unit.