Stability of eigenvalues of quantum graphs with respect to magnetic perturbation and the nodal count of the eigenfunctions