Suppose that $K$ is ramified at $p_1,\ldots,p_n$. Then certainly
$K \subset \mathbb Q(\zeta_{p_1^{m_1}},\ldots,\zeta_{p_n^{m_n}})$ for
some $m_1,\ldots,m_n$.
Now you could try to pin down the field precisely by using some combination of
information about the discriminant and the Galois group of $K/\mathbb Q$.
For example, suppose that our abelian extension $K$ is ramified at a single odd prime $p$.
Then $Gal(\mathbb Q_{\zeta_{p^m}})/\mathbb Q) = (\mathbb Z/p^m\mathbb Z)^{\times}$
is cyclic; in fact it is a product of the cyclic groups
$(1 + p\mathbb Z_p)/(1+p^m\mathbb Z_p)$ (of order $p^{m-1}$) and $(\mathbb Z/p\mathbb Z)^{\times}$ (of order $p-1$).
Any quotient is then equal to $(1+p\mathbb Z_p)/(1+p^{m'}\mathbb Z_p)$ (for $1 \leq m'\leq m$) and some quotient $H$ of $(\mathbb Z/p\mathbb Z)^{\times}$.
Thus if we choose $m$ minimally in the first place, the Galois group
of $K$ over $\mathbb Q$ (which is a quotient of $Gal(\mathbb Q_{\zeta_{p^m}}/
\mathbb Q)$) is isomorphic to $(1 + p\mathbb Z_p)/(1+p^m\mathbb Z_p)\times H$,
for a quotient $H$ as above.
The problem that you asked about is to compute $m$ given $K$. In this case we see that
it is just a matter of computing the power of $p$ dividing the order of
$Gal(K/\mathbb Q)$: the number $m$ is one more than the power of $p$ dividing
this order.
As a slightly more complicated example, suppose that $K$ is ramified at two odd
primes $p < q$, so that $K \subset \mathbb Q(\zeta_{p^m},\zeta_{q^n})$.
Again, let's choose $m$ and $n$ minimally. Then $Gal(K/\mathbb Q)$ is
a quotient of $$(\mathbb Z/p^m\mathbb Z)^{\times} \times
(\mathbb Z/q^n\mathbb Z)^{\times}$$
$$ = (\mathbb Z/p\mathbb Z)^{\times} \times (1 + p\mathbb Z_p)/(1+p^m\mathbb Z_p) \times (\mathbb Z/q\mathbb Z)^{\times} \times (1+q\mathbb Z_q)/(1+q^n\mathbb Z_q)^{\times} .$$
Now we see that it makes a difference whether or not $p | q - 1$. More precisely, suppose that $p^e$ is the precise power of $p$ that divides $q-1$.
Then (thinking about the possible Sylow subgroup structures of a quotient of
the above product, and the fact that $m$ and $n$ were chosen minimally),
we see that $n$ is one more than the power of $q$ dividing the order of
$Gal(K/\mathbb Q)$. On the other hand, if $m'$ is the power of $p$
dividing this order, then what we see is that
$m-1 \leq m' \leq m-1+e$, so if $e \geq 1$, then we have not pinned down
$m$ precisely just by knowing $m'$.
However, if we now apply the conductor-discriminant formula, one will find
that knowledge of the discriminant of $K$ should allow us to determine $m$.
The point is that the contribution to $m'$ that is coming from
the $(\mathbb Z/q\mathbb Z)^{\times}$ factor will lead to additional
powers of $q$ in the discriminant.
As a more precise example, suppose that $e = 1$, and write
$(\mathbb Z/q\mathbb Z)^{\times} = H \times H',$ where $H$ has order prime-to-$p$ and $H'$ has order $p$. Consider two possibilities
for $Gal(K/Q)$. In the first case, suppose that $Gal(K/Q) = (\mathbb Z/p^2\mathbb Z)^{\times} \times H$, while in the second case suppose that
$Gal(K/Q) = (\mathbb Z/p\mathbb Z)^{\times}\times (\mathbb Z/q\mathbb Z)^{\times}$. In each case $Gal(K/Q)$ is the product of
a cyclic group of order $(p-1)$ and a cyclic group of order $(q-1)$.
But in the first case the discriminant (up to sign) will be $p^{2p^2 - 3p} q^{(q-p-1)/p}$, while
in the second case it will be $p^{p-2}q^{q-2}$.
And in the first case we have that $K \subset \mathbb Q(\zeta_{p^2},\zeta_q)$
(but no smaller cyclotomic field), while in the second case
$K = \mathbb Q(\zeta_p,\zeta_q)$.
I didn't try to work this method out more systematically, but presumably one
can, and certainly it shouldn't be so bad to apply by hand to any particular small example that you have in mind.