The causal effect of environment on halo mass and concentration