Black hole thermodynamics from a variational principle: asymptotically conical backgrounds