Politicians reach deal on Northern Ireland