In many of the young galaxies found in the early days of the universe, there was more than enough matter found at the center of the galaxies that the collective strength of gravity was sufficient to curve space enough that even light couldn't escape: a giant black hole. Now, since the galaxies are rotating or spinning, they tend to flatten out into discs, which means that most of the nearby matter close to the black hole is also in that disk. As it falls towards the back hole's event horizon, the accumulating matter in the zone closest to the Black Hole starts speeding up as it falls. It also gets denser, as more and more matter gets crowded together. As a result, the matter picks up enough energy that it literally begins to glow. The resulting electromagnetic radiation (which includes visible light) is visible where it can escape from the galaxy's core without the light being blocked by the matter in the disc of the galaxy.
This radiation pouring out into space like an axle through the wheel of the galaxy is the Quasar.
So, short answer: as matter falls into a black hole, it heats up to the point of glowing. If there's a LOT of matter and it is a VERY large black hole like at the center of the galaxies, we can detect the radiation pouring out. We call it a quasar.
As for the other question...quasars don't directly have much to do with the lifespan of a star (except when it is falling into a supermassive black hole...) so I'll answer that query separately.