Treatment of produced water using chemical and biological unit operations