Two or more counties may execute an agreement under this chapter to create a joint county indigent defense fund to be used to compensate attorneys appointed to represent indigents. In addition to other requirements of an agreement under this chapter, the agreement shall provide for the amount to be paid by each county based on its population to establish and maintain an appropriate balance in the joint fund, and for a method of repayment if a county withdraws more funds than it has contributed.