Agreement contingent on UK measures to meet concerns after night that showed persistence of unionist divisions