The linear stability of a plane Poiseuille flow of an electrically conducting viscoelastic fluid in the presence of a transverse magnetic field is investigated numerically. The fourth-order modified Orr-Sommerfeld equation governing the stability analysis is solved by a spectral method with expansions in Lagrange polynomials, based on collocation points of Gauss-Lobatto. The combined effects of a magnetic field and fluid's elasticity on the stability picture of the plane Poiseuille flow are investigated in two regards. Firstly, the critical values of a Reynolds number and a wavenumber, indicating the onset of instabilities, are computed for several values of a magnetic Hartman number, M, and at different values of an elasticity number, K. Secondly, the structure of the eigenspectrum of the second-order and second-grade models in the Poiseuille flow is studied. In accordance to previous studies, the magnetic field is predicted to have a stabilizing effect on the Poiseuille flow of viscoelastic fluids. Hence, for second-order (SO) fluids for which the elasticity number K is negative, the critical Reynolds number Re, increases with increasing the Hartman number M, for various values of the elasticity number K. However, for second-grade (SG) fluids (K> 0), the critical Reynolds number Re, increases with increasing the Hartman number only for certain values of the elasticity number K, while decreases for the others.