Which two factors contributed to the spread of islam in africa