While the word "Afrique" is feminine, it's preceded by the definite article "l'" which is masculine. This is because the word "Afrique" starts with a vowel sound, and the masculine definite article "le" changes to "l'" before a vowel.
So, even though "Afrique" is feminine, you would use the masculine definite article "l'" when referring to it.