The element distinctness problem for lists of numbers is Θ(n log n) and you can reduce it to your problem in constant time by setting m=2 and checking whether the result is 0. So no, O(n log n) is optimal. (See the comments for a caveat, though)
A bit more explanation for those unfamiliar with the reduction idea: In the mentioned element distinctness problem, you get a list of numbers and you must find out whether they're distinct, i.e., whether there are no duplicates. So given some numbers, how do you solve that task? You could simply give the numbers, along with m=2, to any algorithm that solves Amen's problem. If that tells you "0", then you know there's a duplicate, and if it tells you something larger, then you know there isn't. So if there were an algorithm for Amen's problem faster than n log n, then by using it, you could also solve the distinctness problem faster than n log n. But that problem is already known to not be solvable faster than n log n, meaning Amen's problem isn't, either.
For good measure, here's a Python implementation of the algorithm Amen already mentioned. Sort, find the best window, and output it:
m, n, numbers = 4, 6, [10, 12, 10, 7, 4, 22]
i = min(range(n-m+1), key=lambda i: numbers[i+m-1] - numbers[i])
You can see it in action at ideone. For finding just the difference, it gets even simpler:
print min(high-low for low, high in zip(numbers, numbers[m-1:]))
(yeah I love to advertise Python)