This is actually one of the biggest differences between the book and the film. In the book, the plague is caused by unknown means, but in the film, it is caused by a virus. This virus is a measles virus that was genetically re-engineered as a cure for cancer. Though it initially proved successful, it quickly developed into a lethal strain that killed most of the population and turned the remainder into zombies. The only reason that Dr. Robert Neville survives is because, as a virologist, he has been exposed to these types of viruses and developed an immunity against them.
To find out more about what is known in the film as the Krippin Virus, you can watch the opening scene of the movie where Dr. Alice Krippin (played by Emily Thompson) explains how they discovered it and tried to use it as a cure for cancer.