It is probably your trapezius muscle. It originates in the neck and inserts in the upper back, and it is trapezoid shape. It is responsible for most neck pain. It could be that you are simply sleeping on it wrong, but if it persists, I would mention it at your next doctor appointment.