Singular curves on K3 surfaces