The paper is concerned with a diffuse-interface model that describes two-phase flow of dilute polymeric solutions with a variable particle density. The additional stresses, which arise by elongations of the polymers caused by deformations of the fluid, are described by Kramers stress tensor. The evolution of Kramers stress tensor is modeled by an Oldroyd-B type equation that is coupled to a Navier–Stokes type equation, a Cahn–Hilliard type equation, and a parabolic equation for the particle density. We present a regularized finite element approximation of this model, prove that our scheme is energy stable and that there exist discrete solutions to it. Furthermore, in the case of equal mass densities and two space dimensions, we are able to pass to the limit rigorously as the regularization parameters and the spatial and temporal discretization parameters tend towards zero and prove that a subsequence of discrete solutions converges to a global-in-time weak solution to the unregularized coupled system. To the best of our knowledge, this is the first existence result for a two-phase flow model of viscoelastic fluids with an Oldroyd-B type equation. Additionally, we show that our finite element scheme is fully practical and we present numerical simulations.