Wunderkind Jesse Shapiro says yes:
Some two million Americans are currently incarcerated, with roughly six hundred thousand to be released this year. Despite this, little is known about the effects of confinement conditions on the post-release lives of inmates. In this paper we estimate the causal effect of prison conditions on recidivism rates by exploiting a discontinuity in the assignment of federal prisoners to security levels, and find that harsher prison conditions lead to significantly more post-release crime. We check our identifying assumptions by showing that similar discontinuities do not arise in a control population housed separately from other inmates, and that predetermined correlates of recidivism do not change discretely around score cutoffs. We argue our findings may have important implications for prison policy, and that our methodology is likely to be applicable beyond the particular context we study.
Here is the paper. The authors also argue that these peer effects appear large, relative to the deterrence effects of sending people to nasty prisons. Here is a good recent article on the prison economy.