Iran’s state television says that a magnitude 5.2 earthquake has jolted a town near the country’s capital.