Galaxy distribution in a cold dark matter universe