On the hydrodynamic interaction of shock waves with interstellar clouds. 1: Nonradiative shocks in small clouds