I think the schedule below is close to optimal.
(1 2 v 6 9) (3 4 v 7 10) (5 v 8)
(1 3 v 9 8) (4 5 v 6 7) (2 v 10)
(1 4 v 8 10) (2 5 v 9 7) (3 v 6)
(1 5 v 10 6) (2 3 v 7 8) (4 v 9)
where players 1 to 5 are group A, and players 6 to 10 are group B. Players 1 and 7 are the two players who always play in a foursome. Hope that helps.