'Extremism in all its forms must be defeated,' says Prince William