It largely depends on the state in which you live. Some do not allow any agreements regarding custody, while other states will. However, custody decisions are based on what is in the best interests of a child, so a judge will need to look over what the couple decided to see if he or she agrees with the assessment. If not, that part of the agreement is not considered.
An agreement regarding child support may also not be valid. Each state has a specific way to calculate child support, so the support amount the couple agreed upon must be equal or higher to the state amount.