DUBAI, United Arab Emirates — Iran and Saudi Arabia on Friday agreed to reestablish diplomatic relations and reopen embassies after years of tensions between the two countries, including a devastating attack on the heart of the kingdom's oil production attributed to Tehran. It showed Ali Shamkhani, the secretary of Iran's Supreme National Security Council, with a Saudi official and a Chinese official that state TV named as Wang Yi. Some have hoped for an agreement ahead of the holy Muslim fasting month of Ramadan, which will begin later in March