The following is taken from my dog-eared copy of the New Penguin Atlas of Medieval History. However, the source numbers supposedly come from Colin McEvedy's Atlas of World Population History (which I sadly don't have a copy of. Hint to Santa).
One thing to note is that, since the full advent of the Neolithic age, there have pretty much always been the same number of people in Egypt as in the rest of North Africa combined (mostly living from Tunisia westward). So if you really had a number that said 12 million in Egypt, that would imply there'd be roughly another 12 million in the rest of North Africa (for a total of 24 million). Now here's what Mr. McEvedy had:
737 AD: About 4 million in Spain, mostly in the Mediterranean coastal areas (which were all in Muslim Hands). About 3 million in Egypt and another 3 in the rest of North Africa. About 22 million in the rest of Europe combined (mostly in France, the Low Countries, and Italy).
1,346 AD: About 9 million in Spain, most in either the northern or southern thirds of the peninsula (all but the small Emirate of Granada was in Christian hands). About 4 million in Egypt and another 5 in the rest of North Africa. About 70 Million in the rest of Europe (mostly in areas from Poland and Serbia westwards). The Black Death broke out this year, so this is the highest the population ever got during the entire Middle Ages.