Ian McKellen was asked about reprising the role of Magneto in X-Men 3 and gave an answer at his official website:

Although I haven’t actually signed the contract it is intended that I reprise Magneto in the 3rd X-Men movie. Shooting starts in September in Vancouver, where I shall join the cast after completing my work on Da Vinci Code.