Lateral confinement of fast electrons and its impact on laser ion acceleration