Quadratic Chabauty for modular curves and modular forms of rank one