It sounds as if you signed a post-nuptual agreement. There are a number of criteria that must be met for an agreement of this type to be enforceable. Your not having an attorney of your own is an important fact that will weigh in your favor. Any disclosures or failure to properly disclose on the part of your husband with regard to his finances would also be an important factor. After considering these factors as well as a number of other factors, a court could determine that the agreement is not enforceable. Even if a court were to determine that the agreement is enforceable, the custody provision is not binding. The court will consider the custody provision as being the your and your husband's belief, at the time you signed the agreement, of the best interests of your children. However, the court will need to determine the custodial arrangement that is in the best interests of your children at present. You would be entitled to argue that, notwithstanding the provisions of the agreement, it is in the children's best interest for you to have sole legal custody. You would be well advised to consult with an attorney to review in greater detail the facts of your situtation and the terms of the agreement.
Keith Havens gave you great advice -- read his answer and make an appointment to see an attorney promptly. If you have any bank accoutns on which you are a joint owner with your husband, you may wish to withdraw at least half of that money and deposit it safely in an account in your own sole name. This may be the only way you can hire an attorney, secure for yourself another place to live if necessary, etc. If that attorney was so ignorant of the law that he truly said that he was representing both you and your husband, and met with you to give you advice, then perhaps he also wrote an agreement that is so full of erors and ineffective provisions about your waiver of property rights, that it may be deemed void by the court. If you cannot afford to hire an attorney, see if you can get advice and information from a family pro se or pro bono project or self-help clinic at your local county circuit court house. if you have a custody hearing in ocurt to decide with whom the children will live or how they will be financially supported, the court must always do whatis best fro the children and will disregard any agreement terms that are not in the children's best interest.
You need to speak with an attorney and show him/her the contract you signed. Mr. Havens and Ms. LoPiano are correct that the Agreement may be unenforceable for a few very important reasons (you had no attorney, unclear who the attorney was representing, you didn't have enough information, the outcome is unconscionable, etc.) and that the child provisions (custody, visitation, and child support) are always modifiable. Further, if your children are teenagers then their wishes will be heavily considered by the Court when the Judge considers all the facts to arrive at a decision that is in the children's best interests.
It is unclear whether or not there is an existing case filed with the Court but it seems that you should do that as soon as possible while your attorney tries to come to a settlement with your husband and his attorney. Finally, if you are still living with your husband you will need to speak with a lawyer to determine if you are eligible for a divorce at this time and if not you will need to know what needs to be done to begin that process.
A weekly guide with tips and legal advice for each stage of the process.