A politician from Germany's AfD party converted to Islam and resigned from his position with the far-right party.