Nonequilibrium stationary states with ratchet effect