A lot of people continue east after Egypt/Dahab and most of them go to Petra. There are one-day-tours from Dahab for example for the people who want to do it the easy way. These cost a bit more then 200 euro and will let you stay in Petra a total of 3 (!) hours. Instead of this I recommend you to stay in Petra for a few days, and here is how to do it:
Egypt to Jordan
To travel to Jordan from Egypt is most easy done with the ferry from Nuweiba in Egypt to Aqaba in Jordan. There are two ferries with departures every day:
Fast ferry (1 hour), price 70 USD.
Slow ferry (3 hours), price 60 USD.
In Nuweiba you can only pay your ferry tickets in USD while in Aqaba you can use both USD and JOD. If you plan to go back the same way you will save money buying a return ticket at the same time.
On top of the ferry price you have to pay around 5 euro in departure tax. As with all transportation in Egypt, count with delays.
To go to Nuweiba, take the bus from Dahab which costs 1½ euro. From Cairo, the cost of the bus to Nuweiba should be around 10 euro.
Entry visa for Jordan
A normal entry visa for Jordan cost 30 USD but if you enter through Aqaba (with the ferry like described above) you get a free visa to Jordan. Get the visa on board the ferry. In other case you only have 48 hours to register with the Aqaba Special Economic Zone Authority visa office after arriving, to get the free visa.
Aqaba to Petra
After arrival to Aqaba the best thing is to stay there overnight (around 9 euro for a hostel) and wait for the bus, which costs 8 euro. If you decide to go to Petra directly by taxi instead, this will set you back around 30 euro.
Petra entrance fee
To get into Petra you need to buy an entrance ticket. The price of the ticket is 50 euro for one day, 55 euro for two days and 60 euro for three days.
Hostels in Petra
For a roof over your head in Petra, count with around 6-7 euro per night. It can be a good idea to book a hostel in advance to guarantee a place when you arrive.
Total price for Petra trip from Egypt
An estimated total price one way travel from Dahab to Petra including a 3 day ticket and hostel for three nights: 145 euro