On the maximum principle for deterministic impulse control problems