Is it healthy to stay friends with your ex?

My boyfriend (of a year) recently broke up. We told echogher that we can stay friends. I just want to know if it's okay to stay in contact with him.