Irish parties reach deal on new government but it needs ratification