Density-dependent effective nucleon-nucleon interaction from chiral three-nucleon forces