There are a lot of mobile apps to book a taxi in advance in Barcelona, you can use mytaxi, PideTaxi (I've used this one and I recommend it, this is the official app of the spanish radio taxi association) or Joinup taxi. I linked iOS links but there are also versions for Android.
Besides, if you look for a cheaper option, you can take a train. The Rodalies service opens at 5:00. The closest station to your location should be Estació de França and from there you can take a train to Barcelona Sants and there take one to the airport. It takes around 55 minutes to get to the airport from França. Also, as fedorqui mentions in his comment, you can consider the Aerobús which departures from Plaza Catalunya every 5-10 minutes (the first one at 5:00) and costs 5.90€.