Sleep restores an optimal computational regime in cortical networks