I have always thought that all of the art made during those times were utilitarian in the sense that they were made just to look pretty. Were there any artworks in the middle ages that used context rather content to convey it's message, like a lot of art nowadays does by putting ordinary or ugly things on a pedestal?
I love postmodernism, Dadaism, surrealism etc. And I'd love to know more about those kinds of artworks in those times were art was more traditional.
EDIT: Now that I think about my title I think it may have been a bit badly worded. A better title would be: To what extent instead of did X exist.
The question is a bit tough to address in part because it's so broad: the Middle Ages, depending on who you're talking to and what region you're talking about, can conceivably cover the period from c. 330 to 1500. That's well over a millennium. The term Middle Ages also encompasses vastly different areas and cultures, from northern Europe to North Africa to the Middle East and the Balkans (and more).
All that being said, the broadest answer I can provide is that the art of the Middle Ages in Europe (let's say the period between 500 and 1300) was often, perhaps typically, concerned with much more than just being pretty. In many ways the earliest conceptual art in the West dates back to the Middle Ages, and this despite the fact that it was also supposed to be utilitarian in many cases, as well.
It's also helpful to define "abstract", since that word can mean different things. If you mean "abstract" in the sense of art that is not primarily concerned with representing "reality" as we normally perceive it, then yes, medieval art is literally full of abstract art; one could even say that abstract art is the defining feature of lots of art from the Middle Ages. If you mean "abstract" in the sense of "artistic movements originating in the late 19th and early 20th centuries in the West" then that's different: while there may be parallels or similarities between certain styles separated by hundreds of years, it can be problematic to suggest that something akin to Surrealism exists in Ottonian art, for example. Surrealism, Dadaism, Abstract Expressionism, etc., are rooted to their particular times and places.
There is certainly stuff that looks surreal, like Bosch's The Garden of Earthly Delights for example (although he's more properly Renaissance than Middle Ages). There's also stuff that is non-representational, like carpet pages in medieval manuscripts. And there are representational images meant to convey profound theological tenets, like this image from the Chludov Psalter: the text is the Old Testament (the Psalms), the Crucifixion image is a scene from the New Testament, and the image below, of Iconoclasts (image-destroyers) whitewashing a portrait of Christ, is from recent history (the period of Iconoclasm). The image thus links deep biblical past with Christ's time on earth with recent history, drawing parallels between the people who gave Christ vinegar to drink while he was thirsty on the cross (an event that believers saw foreshadowed in the psalms) and the people who destroyed images. One manuscript page covering three different eras at the same moment! It's brilliant, and way more complex and profound than something just intended to look pretty.
Your best bet, if you're interested in finding out more about how varied and amazing and flat out brilliant medieval art can be, is to check out some good books on the topic. A few you might look into:
Snyder’s Medieval Art (2nd edition) [a decent general survey]
W. Diebold, Word and Image: An Introduction to Early Medieval Art (Boulder, 2000)
Leslie Brubaker, Inventing Byzantine Iconoclasm (London, 2012)
H. Kessler, Spiritual Seeing. Picturing God’s Invisibility in Medieval Art (Pennsylvania, 2000)
Seeing the Invisible in Late Antiquity and the Early Middle Ages, ed. K. Morrison (Turnhout, 2005)
Robin Cormack, Byzantine Art (Oxford: Oxford University Press, 2000)
Thomas Mathews, Byzantium From Antiquity to the Renaissance (New York, 1998)
Late Antique and Medieval Art of the Mediterranean, ed. E. Hoffmann (Malden, MA, 2007)
Barbara Zeitler, Icon and Word: The Power of Images in Byzantium (Aldershot: Asghate, 2003)