Star counts from the Hubble Space Telescope Snapshot Survey. I: Galactic models