The cells have RNA polymerase (DNA primase) which synthesize a short stretch of single stranded RNA molecule for starting replication. This RNA primer provides a free 3'OH group which is required for DNA polymerase to further elongate the strand.
The DNA polymerase can elongate the polynucleotide strand, but cannot synthesize it directly because it needs a free 3'end which is provided by RNA polymerase that is capable of initiating polynucleotide synthesis de novo by positioning ribonucleotide opposite its complimentary DNA base to generate a short stretch of single stranded RNA which is called the RNA primer. Thus, RNA primer is used in DNA replication.
By using RNA instead of DNA as the primer, the system can distinguish which parts must be replaced using the polymerase as the Okazaki fragments are joined providing accuracy to the replication while retaining the speed due to the loose bonding of the RNA primers.