In Minkowski spacetime you assign four coordinates to your events: $x=(x^0,x^1,x^2,x^3)$ - in this notation $x^0 =ct$ and the other three coordinates are the spatial ones. Suppose these are the coordinates of a point in spacetime reached by a light ray which started at the origin, then you have that:
$(x^0)^2=c^2 t^2 = \sum_{i=1}^3 (x^i)^2 \Rightarrow s^2 = -(x^0)^2 + (x^1)^2 + (x^2)^2 + (x^3)^2 =0$
Because $c$ is exactly the speed of light and therefore $ct$ is the distance travelled by the light ray. Now, if you change your coordinate system to a new one (inertial, of course) in such a way that the origin of this new system is also the origin of the old one, you know that:
$(s')^2 = -(x'^{0})^2 + (x^{1})^2 + (x^{2})^2 + (x^{3})^2 = 0$
where $x'^{\mu}$ are the coordinates in the new system. This is because the light ray also starts at the origin of the new system and its speed is also $c$ (remember, the laws of Physics are the same in the two systems, that's relativity!). The thing now becomes a little bit harder, but the main idea is that this relation also holds for general events, not only for those whith $s^2=0$. What I'm saying is that if you have the coordinates of an event $x^{\mu}$ and you define $\eta_{\mu \nu} = \text{diag} \{-1,1,1,1\}$, the quantity:
$$s^2 = \sum_{\mu, \nu = 0}^{4} \eta_{\mu \nu} x^{\mu} x^{\nu} $$
is the same in every inertial system (with the same origin, but this is a minor point). I won't prove this since the details are quite technical and they add nothing but complicate calculations, but it can be done using the fact that every event with $s^2=0$ also has $(s')^2=0$ in a new coordinate system related to the old one by a linear transformation (you want your transformation between inertial systems to be linear to preserve rectilinear motions of free particles). So if you transform your coordinates with a Lorentz transformation so that your event is now at the point $x'^{\mu}$, then:
$$(s')^2 = \sum_{\mu, \nu = 0}^{4} \eta_{\mu \nu} x'^{\mu} x'^{\nu} = s^2 $$
Now you can imagine the reason for that minus sign: it is the only way we have in Minkowski spacetime to create an invariant, a quantity which does not depend in the particular choice of the (inertial) coordinate system. In addition, every four-vector transforms like the coordinates, so in your example with $p=(\frac{E}{c}, \vec{p})$, the quantity $p^2 = -\frac{E^2}{c^2} + \vec{p}^2$ is also independent of the inertial system. This idea generalizes to products of different vectors, in the sense that the dot product of four vectors like the one you wrote:
$$ x \cdot p = -\frac{E}{c}t + \vec{x} \cdot \vec{p} = \sum_{\mu, \nu = 0}^{4} \eta_{\mu \nu} x^{\mu} p^{\nu} $$
is also the same in every inertial system.
In addition, it should be clear now why we can define $\eta_{\mu \nu}$ with two conventions: $(-,+,+,+)$ or $(+,-,-,-)$. In both cases we can define an inner product of four-vectors which gives us an invariant (the only difference is the sign of this invariant).