The influence of the formation and evolution of a (disk) galaxy on the matter distribution in the dark-matter halo is considered. Calculations of the evolution of an isolated dark-matter halo were carried out with and without including a baryonic component. N-body simulations (for the dark-matter halo) and gas-dynamical numerical simulations (for the baryonic gas) were used for this analysis. Star formation, feedback, and heating and cooling of the interstellar medium were taken into account in the gas-dynamical calculations. The results of these numerical simulations with high spatial resolution indicate that 1) including the star formation resolves the so-called cusp problem (according to CDMcosmological models, the density distribution in the central regions of the dark-matter halo should have a distinct peak (cusp), which is not shown by observations); 2) the interaction of the dark matter with dynamical substructures of the stellar-gas galactic disk (spiralwaves, a bar) affects the shape of the dark-matter halo. In particular, the calculated dark-matter distribution in the plane of the disk is more symmetric when the baryonic component is taken into account.