The agreement marked the high point of Turkey’s President Recep Tayyip Erdogan’s recent visit to the Middle East