The effect of energy loss in inclusive hadron production on nuclei