The closest to this quote I've been able to find by googling Project Gutenberg has been this, from (not surprisingly) The Laws.
For if a man were born so divinely gifted that he could naturally apprehend the truth, he would have no need of laws to rule over him; for there is no law or order which is above knowledge, nor can mind, without impiety, be deemed the subject or slave of any man, but rather the lord of all. I speak of mind, true and free, and in harmony with nature. But then there is no such mind anywhere, or at least not much; and therefore we must choose law and order, which are second best.So here, the idea is that if people were smart enough to know what's right and wrong, we wouldn't need laws, but few people are that wise. Law is an imperfect compromise, then, says Plato, but a necessary one.
The problem we have, of course, is that lawmakers are themselves human and rarely much if any wiser than the people to be governed by those laws, so agreeing to follow the laws doesn't seem to get us any closer to doing the right thing than if we were to simply choose on our own.
But I think it's a mistake to think the law is there to tell us what's right. We need laws because we don't all agree on what's right. If we all agreed (even if we were all wrong) that a person ought to do X in situation Y, then we wouldn't need law, because everyone would do X in situation Y and no one would have a problem with it, regardless of whether it was objectively right or wrong, and there would be no need for law. So I prefer to think of the law as the weapon with which we finally resolve our disputes in civilized societies, when we cannot resolve them by more amicable means.
I mean that in more than just a figurative sense, because I believe the law really is a weapon. Consider what distinguishes use as a weapon from other sorts of tool use: weapons are used to reduce the capabilities of the target in some way. A knife can be a tool for separating bits of flesh from each other in surgery or in combat; in surgery the intent is to effect some sort of repair that ultimately enhances the capabilities of the patient, while in combat the intent is to reduce (or eliminate) the target's ability to fight.
The law is purely a weapon in this sense. Law cannot create freedoms; it can only reduce them. But, by pruning away certain freedoms (such as, for instance, the freedom to commit murder), we can allow other freedoms to flourish that otherwise would have been suppressed (such as the freedom to do things that you can't do when you've been murdered).
It may not look like the criminal law is about dispute resolution, but taken as a whole I think it is. It's illegal to kill people not so much because we all (or most of us, anyway) agree that murder is immoral, but because murder violates the rights of the victim to exercise autonomy. So does any sort of violence. Theft and other property crimes are extensions of property law, which is how we resolve disputes over who gets to make decisions involving scarce resources. Contract law allows us to artificially and voluntarily reduce our freedom to break promises, enabling us to rely more on agreements and on the whole, enhancing our range of choices. And so on generally: the ultimate role of law is to resolve disputes.
And that's why we need laws. Not to tell us right from wrong, but to allow each of us to seek after what seems to be right, whatever that may turn out to be.