Decompositions of Semidefinite Matrices and the Perspective Reformulation of Nonseparable Quadratic Programs