A suspected far-right extremist carried out the attack on two shisha bars in western Germany, killing at least nine people, officials say.