When using the Posterize tool, and if you want a specific number of colours in your image, first convert the image to greyscale and specify the number of levels you want. Then convert the image back to the previous colour mode, and replace the various grey tones with the colours you want.