Political theorists have spent a lot of ink trying to justify a general duty to obey the law. Other political theorists have shown that these theories are for the most part very good. Furthermore, the first set of theorists then tend to spend a whole lot more ink explaining why this duty to obey the law commonly ceases to apply if you call what you are doing "civil disobedience".
I'm with the philosophical anarchists - there is no general duty to obey the law. The fact that something is a law does not by itself give moral force to the command. That is not to say, however, that we are no obligated to obey many individual laws. In general, however, the laws we must obey are simply that codify either pre-existing rules of basic morality ("Thou shalt not kill") or certain social conventions where such conventions are necessary ("Thou shalt drive on the left", "if thou pollutest, shalt thou pay a fine of £80 for each tonne of CO2 that thou releasest into yon atmosphere.")
This isn't quite a natural law theory - I would argue that there are significant ways in which the moral conventions may vary without losing authority. And yes, some sets of conventions are better than others, but that doesn't mean that people living under inferior conventions can automatically behave as though the preferred conventions were in place.
To the extent that the law as enforced reflects the actual moral law, then, it will be reasonable to expect those who challenge it through civil disobedience to be willing to defend their actions. The moral justifiability of civil disobedience will, pace Raz, depend to a considerable degree upon whether or not the law they challenge is a just one. That said, if someone is wrong but was acting from good intentions, then it may be reasonable to punish them less harshly than if they were simply disregarding the moral law.