The two countries also backed dialogue and diplomacy to address conflicts while reaffirming their commitment to tackling terrorism