How did islam change the cultures and societies of northern africa