The impact of box size on the properties of dark matter haloes in cosmological simulations