Such a set $B$ is not necessarily a smallest one.
Take for example the set $A$ as two disjoint closed disks in $[0,1]^2$. If we let $B$ be a set that contains $A$ and any line (that does not cross itself) connecting the disks in $A$, then this is an example of a minimal set as you describe. However, clearly we can take different lines to get different sets $B$.
If $X$ is Hausdorff, you can prove the existence of such a set. If $X$ is Hausdorff, we can use that the intersection of a chain of compact connected sets is connected
There always exists such a set $B$, since $X$ is connected. We can order closed connected subsets of $X$ that contain $A$ by inclusion, then every chain of such subsets has a lower bound, as the intersection of the chain will be closed, connected and contain $A$. The existence of $B$ is therefore guaranteed by Zorn's lemma.
A counterexample of a non-Hausdorff space is the line with two origins. If we let $A$ consist of these two origins, then taking intervals $[-\epsilon,\epsilon]$ for any $\epsilon>0$ contains $A$, but the intersection of all such intervals only contains $A$ and is not connected.