I wouldn't call EWR the most pleasant place to sleep though. Before/outside security, the terminal area is rather spartan and I forget if there are even benches you could sleep on. It is not carpeted/quiet/pleasant.
You may want to look into the many cheap hotels ($50-70) around EWR that have shuttle service. Save yourself a sore back and grogginess of 8 hours.