Preparation of Nanocomposite Magnetic Compounds Based on Layered Semiconductors by Means of Electrochemical Intercalation in a Gradient Magnetic Field