It has been stated by the Qur'an (7:172) that Allah took covenant from all the human beings, from Adam to the last man to come before the Last Day. Does this mean that the number of human beings to is already set? If yes then why do people try to upset this divine plan? Why do they take precautionary measures and do abortions etc.? If their number is not fixed then how can we interpret this verse?
According to the Qur'an all the people were presented before the Lord and were made to enter the referred to covenant. They included all the people to come before the Last Day. This means that we cannot add to or subtract the total number of human beings.
However, this number was known to Allah Almighty alone. Human do not know this. Just as we try to treat a disease and do not know whether a patient will survive or not we can take measures and plan our family. Humans may put efforts and plan. Sometimes their efforts work and at times they do not. Their efforts will necessarily match the predestined number of human beings. Those present in the assembly before the Lord are the people who are born and given life in this world. God knew that people will apply such measures and He knew that this effort will fail and that will succeed. He knew the true number of people. Therefore, I do not think there is any contradiction keeping this fact in consideration.