  We explore the cosmic evolution of massive black hole (MBH) seeds forming
within 'quasistars' (QSs), accreting black holes embedded within massive
hydrostatic gaseous envelopes. These structures could form if the infall of gas
into the center of a halo exceeds about 1 solar mass per year. We use a
merger-tree approach to estimate the rate at which QSs might form as a function
of redshift, and the statistical properties of the resulting QS and seed black
hole populations. We relate the triggering of runaway infall to major mergers
of gas-rich galaxies, and to a threshold for global gravitational instability,
which we link to the angular momentum of the host. This is the main parameter
of our models. Once infall is triggered, its rate is determined by the halo
potential; the properties of the resulting QS and seed black hole depend on
this rate. After the epoch of QSs, we model the growth of MBHs within their
hosts in a merger-driven accretion scenario. We compare MBH seeds grown inside
quasistars to a seed model that derives from the remnants of the first
metal-free stars, and also study the case in which both channels of MBH
formation operate simultaneously. We find that a limited range of QS/MBH
formation efficiencies exists that allows one to reproduce observational
constraints. Our models match the density of z = 6 quasars, the cumulative mass
density accreted onto MBHs (according to Soltan's argument), and the current
mass density of MBHs. The mass function of QSs peaks at mass ~ 1e6 solar
masses, and we calculate the number counts for the JWST in the 2-10 micron
band. We find that JWST could detect up to several QSs per field at z ~ 5 - 10.
