Statistical mechanics of nonconservative systems