Self-consistent electronic structure and segregation profiles of the Cu-Ni (001) random-alloy surface