Impulse control of piecewise-deterministic processes