If the problem is that small, you can use brute-force search:
list all rectangles contained in the area,
list all sets of rectangles,
keep those that partition the area,
and select the best one.
To reduce the number of candidates,
you can arrange non-overlapping sets of rectangles into a tree
(the root is the empty set, each level adds one rectangle,
the partitions are among the leaves).
In your implementation, you do not need to store the tree,
you just have to explore it.
If the problem is larger, instead of all rectangles,
you can use the maximal rectangles,
their intersections and differences.
If an approximate solution is acceptable,
you can start with a partition into rectangles
(say, all $1\times1$ rectangles),
grow those rectangles as much as possible (in random directions),
remove or cut them (at random) to have a partition.
Iterate many times and keep the best solution.
I think a similar algorithm is used to
simplify boolean expressions
(but overlaps are allowed).