Nigeria agrees to exit disputed territory in deal with Cameroon