On the problem of coexistence of superconductivity and ferromagnetism