Effect of the displacement reaction on the composition of the magnetic layer in electrodeposited layered nanostructures Co-Cu/Cu and Ni-Cu/Cu