Density profiles of dark matter haloes: diversity and dependence on environment