Solving the Teukolsky equation with physics-informed neural networks