Iran and China have signed a cooperation agreement on various security issues in an effort to enhance stability throughout the region.